package metier;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;

import model.Role;
import model.Site;
import model.User;
import model.alexa.Analyse;
import model.alexa.AudienceGeographique_M;
import model.builtwith.AnalyseBuiltwith;
import model.builtwith.Categorie;
import model.header.AnalyseHeader;
import model.header.Header;
import model.seo.AnalyseSeo;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		XmlBeanFactory bf = new XmlBeanFactory(new ClassPathResource(
				"config.xml"));
		Imetier metier = (Imetier) bf.getBean("metier");

		// metier.deleteSite(3L);

//		 User ac=new User("anas", "aa@aa.aa", "anosi","casa2008");
//		 metier.addUser(ac);

		/*
		 * User u=metier.findUserById(1L); List<Site> s=new ArrayList<Site>();
		 * s=u.getSites(); for(Site s1:s){ System.out.println(s1.getNom_site());
		 * }
		 */
//		Site s = new Site();
//		s = metier.findSitebyId(1L);
//		List<Header> aud = new ArrayList<Header>();
//		List<AnalyseHeader> ana = new ArrayList<AnalyseHeader>();
//		ana = s.getAnalHead();
//		for (AnalyseHeader a : ana) {
//
//			System.out.println(a.getDate());
//			// aud=a.getPaye();
//
//		}
//
//		System.out.println();
Site s=new Site();
s=metier.findSitebyId(1L);
List<AnalyseSeo> ana=new ArrayList<AnalyseSeo>();
ana=s.getSeo();
AnalyseSeo a=ana.get(ana.size()-1);
System.out.println(a.getNbrDiv());
System.out.println(a.getNbrTable());
	}

}
